-
Notifications
You must be signed in to change notification settings - Fork 971
Get directions using fetch #5642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+45
−79
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This pushes json parsing off the js main thread. Hurray |
HolgerJeromin
approved these changes
Feb 10, 2025
Actually needs to be abortable... |
14f5e63
to
c380976
Compare
078e013
to
3d83b11
Compare
I still don't know what I need to change in the testing stub |
I would guess: def stub_straight_routing(start_instruction: "Start here", finish_instruction: "Finish there")
stub_routing <<~CALLBACK
const distance = points[0].distanceTo(points[1]);
const time = distance * 30;
return Promise.resolve({
line: points,
steps: [
[points[0], 8, "<b>1.</b> #{start_instruction}", distance, points],
[points[1], 14, "<b>2.</b> #{finish_instruction}", 0, [points[1]]]
],
distance,
time
});
CALLBACK
end
def stub_routing(callback_code)
execute_script <<~SCRIPT
$(() => {
for (const engine of OSM.Directions.engines) {
engine.getRoute = (points, signal) => {
#{callback_code}
};
}
});
SCRIPT
end
end |
3d83b11
to
66a88d2
Compare
tomhughes
reviewed
Feb 11, 2025
Co-authored-by: Holger Jeromin <h.jeromin@beckhoff.com>
66a88d2
to
e105576
Compare
tomhughes
approved these changes
Feb 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - this looks good now I think.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Start to move from $.ajax to fetch with the thing I recently restructured.